package erp.education.server.db.implementation.finance;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Component;

import erp.education.server.db.entites.finance.FeeGroup;
import erp.education.server.db.implementation.common.BaseDAO;
import erp.education.server.db.interfaces.finance.FeeGroupDAOI;

@Component("feeGroupDao")
public class FeeGroupDAO extends BaseDAO implements FeeGroupDAOI {

	@Override
	public FeeGroup getFeeGroup(Long groupId) {
		// TODO Auto-generated method stub
		FeeGroup feeGroup = null;
		Map params = new HashMap();

		params.put("groupId", groupId);

		feeGroup = (FeeGroup) getSingleResult(
				"select feeGroup from FeeGroup feeGroup where feeGroup.groupId=:groupId",
				params);

		return feeGroup;
	}

	@Override
	public List<FeeGroup> getFeeGroups() {
		// TODO Auto-generated method stub
		List<FeeGroup> feeGroups = null;
		Map params = new HashMap();
		feeGroups = (List<FeeGroup>) getResultList(
				"select feeGroup from FeeGroup feeGroup ", params);
		return feeGroups;

	}
}
